<template>
  <el-dialog
    v-model="dialogVisible"
    title="Tips"
    width="30%"
    @close="handleClose"
  >
    <span>二次密码</span>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="handleClose">Cancel</el-button>
        <el-button type="primary" @click="confirmBtn">
          Confirm
        </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref ,defineComponent} from 'vue'
import { ElButton, ElDialog } from 'element-plus'
defineComponent({
  components: {
    ElButton, ElDialog
  },
});

const dialogVisible = ref(true);
const props = defineProps(['callback','destroy']);

const handleClose = () => {
  // 销毁弹窗
  props.destroy();
};

const confirmBtn = () => {
  dialogVisible.value = false;
  props.callback();
  // 销毁弹窗
  props.destroy();
}


</script>
<style scoped>
.dialog-footer button:first-child {
  margin-right: 10px;
}
</style>